import tensorflow as tf

x = tf.linspace(-10., 10., 11)

with tf.GradientTape() as tape:
    tape.watch(x)
    y = tf.sigmoid(x)

gradient = tape.gradient(y, [x])

print(x)
print(y)
print(gradient)
